package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.dto.CategoryDTO;
import com.leyou.item.entity.Category;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

public interface CategoryMapper extends BaseMapper<Category> {
    // 根据品牌id，查询商品分类的集合
    @Select("select id, name, parentId, isParent, sort from tb_category tc left join tb_category_brand cb on tc.id = cb.category_id where cb.id = #{bid} ")
    List<CategoryDTO> queryCategoryByBrandId(@Param("bid") Long bid);
}
